import axios from 'axios'

const request = axios.create({
    timeout: 5000
})

request.interceptors.request.use(
    function (config) {
        return config
    },
    function (error) {
        return Promise.reject(error)
    }
)
request.interceptors.response.use(
    function (response) {
        const res = code.response
        if (code !== 200) {
            alert("报错")
        } else {
            return res
        }
    },
    function (error) {
        return Promise.reject(error)
    }
)
export default request
